package online.xuping.center.account.impl;

import online.xuping.center.account.IAccountTypeService;
import online.xuping.center.account.domain.AccountTypeDomain;
import online.xuping.common.SettingUtil;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 账户类型设置
 */
@Service
public class AccountTypeServiceImpl implements IAccountTypeService {
    @Override
    public List<AccountTypeDomain> findAllAccountType() {
        List<String> list = SettingUtil.getList("config/account.setting", "accountType");
        List<AccountTypeDomain> re  = new ArrayList();
        list.stream().forEach(it->{
            re.add(AccountTypeDomain.builder().accountTypeName(it).build());
        });
        return re;
    }
}
